package com.xr.security;

import org.marmot.framework.menu.factory.MenuFactory;

import java.util.List;

import com.bstek.dorado.data.AbstractDatasetListener;
import com.bstek.dorado.data.Dataset;
/**
 * MenuItemDatasetListener
 */
public class MenuItemDatasetListener  extends AbstractDatasetListener{

	private MenuFactory menuFactory;

	public void setMenuFactory(MenuFactory menuFactory) {
		this.menuFactory = menuFactory;
	}

	public void afterLoadData(Dataset dataset) throws Exception {
		String parentItemId = dataset.parameters().getString("parentItemId");
		List items = menuFactory.getMenuItems(parentItemId);
		dataset.fromDO(items);
	}

}
